home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_c
/
lsdoor09.zip
/
REINDEX.CPP
< prev
next >
Wrap
Text File
|
1996-05-15
|
875b
|
45 lines
// This is an example of how you can re-index damage database...
// This is only a code fragment. You will have to replace 'database'
// with the name of your database, and database.keydata with whatever you
// are using for a key.
#define MainModule
#include "LsDoor.h"
extern int DisableIndexes;
Entry entry;
Index ixp;
void main( void )
{
int ii, ret;
DisableIndexes = true;
printf("\nReindexing the database...");
create_index( "User.Idx", &ixp, 1 );
ii=0;
open_database();
while( next_database() )
{
scanner();
strcpy( entry.key, database.keydata );
entry.data = _data_fpos;
ret = add_key( &ixp, &entry );
if( ret ){ printf("\nError adding key!\n"); break; }
}
clear_scanner();
close_database();
close_index( &ixp );
DisableIndexes = false;
}
// End of ReIndex.Cpp